package se.webbzon.oschi01.collision3d;

import javax.vecmath.Matrix3d;
import javax.vecmath.Point3d;

import se.webbzon.oschi01.friendly.Friendly;

@Friendly final class CollisionAllocation3D {
	
	// The allocated set of Point3d
	private final Point3d[] points;
	
	// The allocated set of Matrix3d
	private final Matrix3d[] matrices;
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new allocation which can be used to detect intersections
	 * between two CollisionTriangle3D. **/
	@Friendly CollisionAllocation3D() {
		points = new Point3d[] {
				new Point3d(),
				new Point3d(),
				new Point3d(),
				new Point3d(),
				new Point3d(),
				new Point3d(),
				new Point3d()
		};
		matrices = new Matrix3d[] {
				new Matrix3d(),
				new Matrix3d()
		};
		
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** Returns the (n+1):th allocated Point3d instance,
	 * where n = 0,1,...,6. **/
	@Friendly final Point3d getAllocatedPoint(int n) {
		return points[n];
	}
	
	/** Returns the (n+1):th allocated Matrix3d instance,
	 * where n = 0,1. **/
	@Friendly final Matrix3d getAllocatedMatrix(int n) {
		return matrices[n];
	}

}
